Repository navigation
fix(lint/no-base-to-string): treat Symbol.toPrimitive methods as custom stringification - #1143
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
0e75fb0 to
b1ee872
Compare
Merging this PR will not alter performanceWarning oxc-project has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed. 1 warning
Comparing Footnotes
|
b1ee872 to
f927905
Compare
Performance change vs mainWorkflow run · main Clef gate: Running benchmarks because the decision was unavailable (crates/tsrs_lint/src/rules/no_base_to_string.rs: patch exceeds the Clef context limit (9485 bytes)). Release builds in fast mode (TSRS_FAST=1) with Hyperfine 2 hardware counters. After warming each binary, alternating main/PR pairs measure wall time at both the fast preset's default checker count and with --singleThreaded, with ten pairs per configuration by default. Instructions come from the single-threaded runs; peak RSS comes from the default-count runs.
Negative means the PR used less; positive means it used more. Deltas are medians of paired PR/main ratios for wall time and instructions. Single-threaded runs reduce scheduling noise; shared CI machines can still add noise to wall time. Measured medians (main → PR)
tsrs-lintRelease
Negative means the PR used less. Wall and CPU time deltas are medians of paired PR/main ratios; peak RSS compares medians. Measured lint medians (main → PR)
|
…om stringification
f927905 to
66a3c8c
Compare
Ports oxc-project/tsgolint#1398 to tsrs.
An object type that declares a
[Symbol.toPrimitive]method defines its own coercion. The rule still fell back toObject'stoString/valueOfand reported it:Before checking
toString,toLocaleStringandvalueOf, treat the type as always useful when one of its properties is a method signature keyed bySymbol.toPrimitive, whereSymbolresolves to the default library. This matches tsgolint7f5c22e5. The certainty helpers now take the program so they can run that library check. This refreshes the rule baseline to that commit and adds the upstream cases.Validation: the
no-base-to-stringbaseline (384 cases, 1 upstream skip), theno_base_to_stringheadless test,cargo clippy -p tsrs_lint --all-targetswith warnings denied, andtools/lint/source.mjs.